-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE UpdateWorkData
	-- Add the parameters for the stored procedure here
	
	@startTime  numeric(4,0),
    @endTime  numeric(4,0),
	@startTimeA  numeric(4,0),
    @endTimeA  numeric(4,0),
	@timetableNo  numeric(3,0),
	@exFrom  numeric(8,0),
	@exTo  numeric(8,0),
	@restTime  numeric(4,0),
	@organNo  nvarchar(20),
	@empNo  nvarchar(50),
	@workDate  numeric(8,0),
	@workTime  numeric(4,0),
	@overtime  numeric(4,0),
	@lateness  numeric(4,0),
	@leaveEarly  numeric(4,0),
	@memo  nvarchar(MAX),
	@workDays  numeric(2,1),
	@paidVacation  numeric(2,1),
	@specialHolidays  numeric(2,1),
	@absenceDays  numeric(2,1),
	@holidayDays  numeric(2,1),
	@compensatoryDayOff  numeric(2,1),
	@workTypeNo  numeric(2,0),
	@contractTime numeric(4,0),
	@holidayTime numeric(4,0)
		
AS

BEGIN

	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
    UPDATE WORK_DATA SET START_TIME =  @startTime,
						 END_TIME =  @endTime, 
						 UPDATE_START_TIME =  @startTimeA, 
						 UPDATE_END_TIME =  @endTimeA,
                         TIME_TABLE_NO =  @timetableNo, 
                         REST_TIME =  @restTime, 
                         WORKING_TIME =  @workTime,
                         OVER_TIME =  @overtime, 
                         BEING_LATE_TIME =  @lateness , 
                         LEAVING_EARLY_TIME =  @leaveEarly,
                         COMPENSATORY_DAY_OFF =  @compensatoryDayOff,
                         ABSENCE_DAYS =  @absenceDays,  
                         SPECIAL_HOLIDAYS =  @specialHolidays ,  
                         PAID_VACATION_DAYS =  @paidVacation,
                         WORK_TYPE_NO =  @workTypeNo ,  
                         HOLIDAY_DAYS =  @holidayDays ,  
                         WORK_DAYS =  @workDays,
                         UPDATE_DATE_TIME = GETDATE(), 
                         MEMO = @memo,
                         EXPIRATION_FROM = @exFrom,
                         EXPIRATION_TO =@exTo,
                         CONTRACT_TIME = @contractTime,
                         HOLIDAY_TIME = @holidayTime
                         
                         
                   WHERE ORGANIZATIONAL_NO =  @organNo AND EMPLOYEE_NO = @empNo AND WORK_DATE =  @workDate
	
END

GO
